# coding:utf-8
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from .models import user


class ProfileInline(admin.StackedInline):
    model = user
    max_num = 1
    can_delete = False



class UserProfileAdmin(UserAdmin):
    fieldsets = ((None, {'fields': ('username', 'password', 'email', 'last_login', 'date_joined',)}),
    ('权限管理', {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}),
    )

    inlines = [ProfileInline, ]


admin.site.unregister(User)
admin.site.register(User, UserProfileAdmin)